package com.iqiyi.pps.epg.core.model.rtmp;

import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;

import javax.persistence.*;
import java.sql.Timestamp;

@Entity
@Table(name = "rtmp_server_pfv")
@Cache(usage = CacheConcurrencyStrategy.NONE)
public class RtmpServerPfv {
    public static final int STATUS_VALID = 2; // 有效
    public static final int STATUS_INVALID = 1; // 无效

    private Long id;
    private Integer serverId;
    private String name;
    private Integer bitrate;
    private String object;
    private String download;
    private String downloadTotal;
    private String downloadErrorCode;
    private Integer downloadRetryTimes;
    private String downloadDuration;
    private String upload;
    private String uploadTotal;
    private String uploadErrorCode;
    private Integer uploadRetryTimes;
    private String uploadDuration;
    private String mirror;
    private Integer status;
    private Timestamp createTime = new Timestamp(System.currentTimeMillis());
    private Timestamp modifyTime;

    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    @Column(name = "server_id")
    public Integer getServerId() {
        return serverId;
    }

    public void setServerId(Integer serverId) {
        this.serverId = serverId;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Integer getBitrate() {
        return bitrate;
    }

    public void setBitrate(Integer bitrate) {
        this.bitrate = bitrate;
    }

    public String getObject() {
        return object;
    }

    public void setObject(String object) {
        this.object = object;
    }

    public String getDownload() {
        return download;
    }

    public void setDownload(String download) {
        this.download = download;
    }

    @Column(name = "download_total")
    public String getDownloadTotal() {
        return downloadTotal;
    }

    public void setDownloadTotal(String downloadTotal) {
        this.downloadTotal = downloadTotal;
    }

    @Column(name = "download_error_code")
    public String getDownloadErrorCode() {
        return downloadErrorCode;
    }

    public void setDownloadErrorCode(String downloadErrorCode) {
        this.downloadErrorCode = downloadErrorCode;
    }

    @Column(name = "download_retry_times")
    public Integer getDownloadRetryTimes() {
        return downloadRetryTimes;
    }

    public void setDownloadRetryTimes(Integer downloadRetryTimes) {
        this.downloadRetryTimes = downloadRetryTimes;
    }

    @Column(name = "download_duration")
    public String getDownloadDuration() {
        return downloadDuration;
    }

    public void setDownloadDuration(String downloadDuration) {
        this.downloadDuration = downloadDuration;
    }

    public String getUpload() {
        return upload;
    }

    public void setUpload(String upload) {
        this.upload = upload;
    }

    @Column(name = "upload_total")
    public String getUploadTotal() {
        return uploadTotal;
    }

    public void setUploadTotal(String uploadTotal) {
        this.uploadTotal = uploadTotal;
    }

    @Column(name = "upload_error_code")
    public String getUploadErrorCode() {
        return uploadErrorCode;
    }

    public void setUploadErrorCode(String uploadErrorCode) {
        this.uploadErrorCode = uploadErrorCode;
    }

    @Column(name = "upload_retry_times")
    public Integer getUploadRetryTimes() {
        return uploadRetryTimes;
    }

    public void setUploadRetryTimes(Integer uploadRetryTimes) {
        this.uploadRetryTimes = uploadRetryTimes;
    }

    @Column(name = "upload_duration")
    public String getUploadDuration() {
        return uploadDuration;
    }

    public void setUploadDuration(String uploadDuration) {
        this.uploadDuration = uploadDuration;
    }

    public String getMirror() {
        return mirror;
    }

    public void setMirror(String mirror) {
        this.mirror = mirror;
    }

    public Integer getStatus() {
        return status;
    }

    public void setStatus(Integer status) {
        this.status = status;
    }

    @Column(name = "create_time", updatable = false)
    public Timestamp getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Timestamp createTime) {
        this.createTime = createTime;
    }

    @Column(name = "modify_time", insertable = false, updatable = false)
    public Timestamp getModifyTime() {
        return modifyTime;
    }

    public void setModifyTime(Timestamp modifyTime) {
        this.modifyTime = modifyTime;
    }
}
